home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagn_r.zip / NETWORK.SWG / 0001_DETCNETX.PAS.pas next >
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  61 lines

  1. {
  2. ▒i'm trying to find a method by which i can, from within a TP Program,
  3. ▒detect whether or not the NetWare shell has been loaded (Net3, NetX, or
  4. ▒whatever); i've figured out how to determine if IPX is running, but
  5. ▒can't seem to nail down the shell; the general idea is to detect IPX,
  6. ▒detect the shell, determine whether or not the user is logged in, and if
  7. ▒not, give them the oppurtUnity to do so; i've got most of the rest
  8. ▒figured out, but can't find the shell; any help would be greatly
  9. ▒appreciated
  10.  
  11. Try Interrupt 21h, Function EAh, GetShellVersion;
  12. }
  13.  
  14. Uses
  15.   {$IFDEF DPMI}
  16.   WinDos;
  17.   {$ELSE}
  18.   Dos;
  19.   {$endIF}
  20. Var
  21.   vOS,
  22.   vHardwareType,
  23.   vShellMajorVer,
  24.   vShellMinorVer,
  25.   vShellType,
  26.   vShellRevision  : Byte;
  27.   {$IFDEF DPMI}
  28.   vRegs : tRegisters;
  29.   {$ELSE}
  30.   vRegs : Registers;
  31.   {$endIF}
  32.  
  33. Procedure GetShellVersion;
  34. begin
  35.   vOS            := 0;
  36.   vHardwareType  := 0;
  37.   vShellMajorVer := 0;
  38.   vShellMinorVer := 0;
  39.   vShellType     := 0;
  40.   vShellRevision := 0;
  41.   FillChar(vRegs, SizeOf(vRegs), 0);
  42.   With vRegs DO
  43.   begin
  44.     AH := $EA;
  45.     Intr($21, vRegs);
  46.     vOS := AH;              (* $00 = MS-Dos *)
  47.     vHardwareType := AL;    (* $00 = PC, $01 = Victor 9000 *)
  48.     vShellMajorVer := BH;
  49.     vShellMinorVer := BL;
  50.     vShellType := CH;       (* $00 = conventional memory *)
  51.                             (* $01 = expanded memory     *)
  52.                             (* $02 = extended memory     *)
  53.     vShellRevision := CL;
  54.   end;
  55. end;
  56.  
  57. begin
  58.   GetShellVersion;
  59.   Writeln(vOS);
  60.   Readln;
  61. end.